<template>
    <div>
        <div class="b-c2">
            <div class="z-header width-75 tc c-f">
                <div @click="$router.back(-1)" class="lt">
                    <i class="iconfont icon-zuo m-t-18"></i>
                </div>
                <div class="fs-36">
                    添加好友
                </div>
            </div>
        </div>
        <div class="index-blank"></div>
        <div>
            <input type="text" placeholder="请输入手机号" class="addFriend-index" v-model="faccid">
            <button class="addFriend-button" @click="friend">确定</button>
        </div>
    </div>
</template>
<script>
import { z } from '../assets/js/common'
export default {
    data() {
        return {
            faccid: "",
        }

    },
    methods: {
        friend() {
            var params = new URLSearchParams();
            params.append("faccid", this.faccid);
            params.append("type", 1);
            params.append("msg", "sb");
            this.$http({
                method:"post",
                url: localPath + "/im/addFriend",
                data:params
            }).then((data)=>{
                console.log(data);
            }).catch((error)=>{
                console.log(error);
            })
        }
    },
    mounted() {
         document.addEventListener(z());
    },
}
</script>
<style>
.addFriend-index {
    width: 84%;
}

.addFriend-button {
    background: #c29354;
    color: #ffffff;
    width: 1.1rem;
    height: .56rem;
}
</style>

